/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.crossriver.crgis.database.model;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;

/**
 * @author Wole Adetiba
 */
public class History_Of_InformationClp extends BaseModelImpl<History_Of_Information>
	implements History_Of_Information {
	public History_Of_InformationClp() {
	}

	public String getPrimaryKey() {
		return _historyInfoId;
	}

	public void setPrimaryKey(String pk) {
		setHistoryInfoId(pk);
	}

	public Serializable getPrimaryKeyObj() {
		return _historyInfoId;
	}

	public String getHistoryInfoId() {
		return _historyInfoId;
	}

	public void setHistoryInfoId(String historyInfoId) {
		_historyInfoId = historyInfoId;
	}

	public String getApplicationId() {
		return _applicationId;
	}

	public void setApplicationId(String applicationId) {
		_applicationId = applicationId;
	}

	public String getUserId() {
		return _userId;
	}

	public void setUserId(String userId) {
		_userId = userId;
	}

	public String getOldApplicationId() {
		return _oldApplicationId;
	}

	public void setOldApplicationId(String oldApplicationId) {
		_oldApplicationId = oldApplicationId;
	}

	public History_Of_Information toEscapedModel() {
		if (isEscapedModel()) {
			return this;
		}
		else {
			return (History_Of_Information)Proxy.newProxyInstance(History_Of_Information.class.getClassLoader(),
				new Class[] { History_Of_Information.class },
				new AutoEscapeBeanHandler(this));
		}
	}

	public Object clone() {
		History_Of_InformationClp clone = new History_Of_InformationClp();

		clone.setHistoryInfoId(getHistoryInfoId());
		clone.setApplicationId(getApplicationId());
		clone.setUserId(getUserId());
		clone.setOldApplicationId(getOldApplicationId());

		return clone;
	}

	public int compareTo(History_Of_Information history_Of_Information) {
		int value = 0;

		value = getHistoryInfoId()
					.compareTo(history_Of_Information.getHistoryInfoId());

		if (value != 0) {
			return value;
		}

		return 0;
	}

	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}

		History_Of_InformationClp history_Of_Information = null;

		try {
			history_Of_Information = (History_Of_InformationClp)obj;
		}
		catch (ClassCastException cce) {
			return false;
		}

		String pk = history_Of_Information.getPrimaryKey();

		if (getPrimaryKey().equals(pk)) {
			return true;
		}
		else {
			return false;
		}
	}

	public int hashCode() {
		return getPrimaryKey().hashCode();
	}

	public String toString() {
		StringBundler sb = new StringBundler(9);

		sb.append("{historyInfoId=");
		sb.append(getHistoryInfoId());
		sb.append(", applicationId=");
		sb.append(getApplicationId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", oldApplicationId=");
		sb.append(getOldApplicationId());
		sb.append("}");

		return sb.toString();
	}

	public String toXmlString() {
		StringBundler sb = new StringBundler(16);

		sb.append("<model><model-name>");
		sb.append("com.crossriver.crgis.database.model.History_Of_Information");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>historyInfoId</column-name><column-value><![CDATA[");
		sb.append(getHistoryInfoId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>applicationId</column-name><column-value><![CDATA[");
		sb.append(getApplicationId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>oldApplicationId</column-name><column-value><![CDATA[");
		sb.append(getOldApplicationId());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private String _historyInfoId;
	private String _applicationId;
	private String _userId;
	private String _oldApplicationId;
}